<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图片高清显示</title>
    <style>
        #logo{
            width: 200px;
            height: 200px;
            border:solid 1px #ddd;
            background: url('./image/logo.png');
            background-size: cover;
        }

        @media screen and (-webkit-min-device-pixel-ratio: 2) {
            #logo{
                background: url('./image/logo@2x.png');
                background-size: cover;
            }
        }

        @media screen and (-webkit-min-device-pixel-ratio: 3) {
            #logo{
                background: url('./image/logo@3x.png');
                background-size: cover;
            }
        }

    </style>
</head>
<body>
    <img src="./image/logo.png" alt="">
    <div id="logo"></div>

    <div id="dpr"></div>
    <script>
        dpr.innerHTML = window.devicePixelRatio;
    </script>
</body>
</html>